package com.cykj.pos.insideLogin.controller;

import com.cykj.common.core.controller.BaseController;
import com.cykj.common.core.domain.AjaxResult;
import com.cykj.common.core.page.AppTableData;
import com.cykj.pos.insideLogin.domain.ao.InsideUserAO;
import com.cykj.pos.insideLogin.domain.ao.UserVO;
import com.cykj.pos.insideLogin.service.InsideLoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author wangjiaqi
 * @date 2021/12/29
 */
@Api(tags = "无验证登录(内部)")
@RequestMapping("/inside")
@RestController
public class InsideLoginController extends BaseController {

    @Resource
    private InsideLoginService insideLoginService;

    @ApiOperation("无验证登录获取用户")
    @PostMapping("/findUser")
    public AppTableData findUser(@RequestBody UserVO userVO) {
        appPage();
        return getAppDataTableList(insideLoginService.findUser(userVO.getNickName()));
    }

    @ApiOperation("无验证登录 自用")
    @PostMapping("/loginOwn")
    public AjaxResult loginOwn(@RequestBody InsideUserAO insideUserAO) {
        return AjaxResult.success("登陆成功", insideLoginService.loginOwn(insideUserAO));
    }
}
